// 导入组件
import Vue from 'vue';
import Router from 'vue-router';
// 登录
import login from '@/views/login';
// 首页
import index from '@/views/index';
/**
 * 基础菜单
 */
// 商品管理
import Goods from '@/views/goods/Goods';
// 机器信息管理
// 货道信息管理
/**
 * 订单管理
 */
// 交易订单
import Order from '@/views/pay/Order';

import statistics from '@/views/charts/statistics';
import Register from "../views/Register";
import BRegister from "../views/bRegister";
import blogin from "../views/blogin";
import uindex from "../views/uindex";
import dashboard from "../views/dashboard";
import Hotel from "../views/hotel/Hotel";
import photograph from "../views/photograph/Photograph";

// 启用路由
Vue.use(Router);

// 导出路由
export default new Router({
  routes: [{
    path: '/',
    name: '',
    redirect: 'u/dashboard',
    component: uindex,
    hidden: true, meta: {
      requireAuth: false
    }
  }, {
    path: '/u',
    redirect: 'u/dashboard',
    component: uindex,
    children: [{
      path: "dashboard",
      name: "首页",
      component: () => import("@/views/dashboard.vue"),

    }, {
      path: "about",
      name: "关于",
      component: () => import(/* webpackChunkName: "about" */ "../views/about.vue"),
    }, {
      path: "hotel",
      name: "场地",
      component: () => import(/* webpackChunkName: "about" */ "../views/hotel.vue"),
    }, //房产经纪
      {
        path: "photo",
        name: "摄影",
        component: () => import(/* webpackChunkName: "about" */ "../views/photo.vue"),
      }, //房产详情
      {
        path: "shoppingcar",
        name: "购物车",
        component: () => import(/* webpackChunkName: "about" */ "../views/shoppingcar.vue"),
      }, // 地产列表
      {
        path: "myorder",
        name: "订单",
        component: () => import(/* webpackChunkName: "about" */ "../views/myorder.vue"),
      },


      {
        path: "goods",
        name: "婚品商城",
        component: () => import("@/views/goods.vue"),
      },


    ]

  }, {
    path: '/login',
    name: '登录',
    component: login,
    meta: {
      requireAuth: false
    }
  }, {
    path: '/register',
    name: '登录',
    component: Register,
    hidden: true, meta: {
      requireAuth: false
    }
  }, {
    path: '/bregister',
    name: '登录',
    component: BRegister,
    hidden: true, meta: {
      requireAuth: false
    }
  }, {
    path: '/blogin',
    name: '登录',
    component: blogin,
    hidden: true, meta: {
      requireAuth: false
    }
  }, {
    path: '/index',
    name: '首页',
    component: index,
    iconCls: 'el-icon-tickets', children: [{
      path: '/goods/Goods',
      name: '商品管理',
      component: Goods, meta: {
        requireAuth: true
      }
    }, {
      path: '/goods/hotel',
      name: '商品管理',
      component: Hotel, meta: {
        requireAuth: true
      }
    }, {
      path: '/goods/photograph',
      name: '商品管理',
      component: photograph, meta: {
        requireAuth: true
      }
    }, {
      path: '/pay/Order',
      name: '交易订单',
      component: Order, meta: {
        requireAuth: true
      }
    }, {
      path: '/charts/statistics',
      name: '数据可视化',
      component: statistics, meta: {
        requireAuth: true
      }
    }]
  }]
})
